public class Test {
    public static void main(String[] args) {
        SingleList singlelist =  new SingleList();
        singlelist.createNode();

        singlelist.show();

        System.out.println("链表的长度为：" + singlelist.size());

        System.out.println("查找2这个元素：" + singlelist.contains(2));
        System.out.println("查找100这个元素：" + singlelist.contains(100));


        System.out.println("头插");
        singlelist.addFirst(100);
        singlelist.show();
        singlelist.addFirst(200);
        singlelist.show();


        System.out.println("尾插");
        singlelist.addLast(10086);
        singlelist.show();

        System.out.println("在indext下标前插入元素");
        singlelist.addIndext(3, 120);
        singlelist.show();

        System.out.println("删除第一个key");
        singlelist.remove(10086);
        singlelist.show();

        System.out.println("删除所有的key");
        System.out.print("删除前：");
        SingleList singlelist1 = new SingleList();
        singlelist1.addLast(1);
        singlelist1.addLast(1);
        singlelist1.addLast(1);
        singlelist1.addLast(1);
        singlelist1.addLast(1);

        singlelist1.show();
       // singlelist1.removeAllKey(1);

        System.out.print("删除后：");
        singlelist1.show();

        System.out.println("清空");
        singlelist.clear();
        singlelist.show();
        singlelist1.clear();
        singlelist1.show();
    }

}
